package com.twu.biblioteca;

import java.util.ArrayList;

/**
 * Created by Nishi on 8/1/14.
 */
public class Movie {

    private String movieName;
    private int year;
    private String director;
    private int availableQuantity;
    private int rating;

    public Movie(){

    }
    // constructors : with and without rating
    public Movie(String movieName,int year,String director,int availableQuantity){
        this.movieName = movieName;
        this.year = year;
        this.director = director;
        this.availableQuantity = availableQuantity;
    }

    public Movie(String movieName,int year,String director,int availableQuantity, int rating ){
        this.movieName = movieName;
        this.year = year;
        this.director = director;
        this.availableQuantity = availableQuantity;
        this.rating = rating;
    }

    public String toString() {
        if(rating == 0){
            return ( movieName +"\t\t"+ year +"\t\t"+director+"\t\t"+availableQuantity+"\t\t"+"Unrated"+"\n");
        }
        else
        return ( movieName +"\t\t"+ year +"\t\t"+director+"\t\t"+availableQuantity+"\t\t"+rating+"\n");
    }

    public int getAvailableQuantity(){
        return availableQuantity;
    }
    public String getMovieName() {
        return movieName;
    }
    public void setAvailableQuantity(int number){
        availableQuantity = number;
    }
}

